//
//  XKTapImageView.m
//  Selene
//
//  Created by 刘晓凯 on 2017/3/13.
//  Copyright © 2017年 hairun. All rights reserved.
//

#import "XKTapImageView.h"

@implementation XKTapImageView

- (instancetype)init {
    self = [super init];
    if (self) {
        UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureImageView:)];
        [self addGestureRecognizer:tapGesture];
        self.clipsToBounds = YES;
        self.userInteractionEnabled = YES;
    }
    return self;
}

- (void)tapGestureImageView:(UIGestureRecognizer *)gesture {
    if ([self.tapDelegate respondsToSelector:@selector(tapGestureWithObject:)]) {
        [self.tapDelegate tapGestureWithObject:self];
//        NSLog(@"XKTapImageView代理%@传值%@",self.tapDelegate,self);
    }
}

- (void)dealloc {
    self.tapDelegate = nil;
}

@end
